package entity

import (
	"encoding/json"
	"github.com/lib/pq"
)

type FeePlanGroup struct {
	Id             int64           `gorm:"column:id;primary_key;comment:主键ID" json:"id"`
	Name           string          `gorm:"column:name;type:varchar(255);comment:名称" json:"name"`
	Remark         string          `gorm:"column:remark;type:varchar(255);comment:备注" json:"remark"`
	BitmapEbikeIds string          `gorm:"column:bitmap_ebike_ids;type:text;comment:设备列表的bitmap序列号字符串" json:"bitmap_ebike_ids"`
	FeePlanIds     pq.Int64Array   `gorm:"column:fee_plan_ids;type:bigint[];comment:套餐列表" json:"fee_plan_ids"`
	FeePlanDetail  json.RawMessage `gorm:"column:fee_plan_detail;type:json;comment:套餐列表详情" json:"fee_plan_detail"`
	Def            int             `gorm:"column:def;type:smallint default 0 not null;comment:是否是默认套餐组(1:是,0:否)" json:"def"`
	Enable         int             `gorm:"column:enable;type:smallint default 1 not null;comment:是否是默认套餐组(1:是,0:否)" json:"enable"`
	CreatedAt      int64           `gorm:"column:created_at;type:bigint;comment:创建时间" json:"created_at"`
	UpdatedAt      int64           `gorm:"column:updated_at;type:bigint;comment:更新时间" json:"updated_at"`
}

func (f *FeePlanGroup) TableName() string {
	return "fee_plan_group"
}
